import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_tracker/flutter_tracker.dart';
import 'package:flutter_tracker/flutter_tracker_platform_interface.dart';
import 'package:flutter_tracker/flutter_tracker_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterTrackerPlatform
    with MockPlatformInterfaceMixin
    implements FlutterTrackerPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterTrackerPlatform initialPlatform = FlutterTrackerPlatform.instance;

  test('$MethodChannelFlutterTracker is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterTracker>());
  });

  test('getPlatformVersion', () async {
    FlutterTracker flutterTrackerPlugin = FlutterTracker();
    MockFlutterTrackerPlatform fakePlatform = MockFlutterTrackerPlatform();
    FlutterTrackerPlatform.instance = fakePlatform;

    expect(await flutterTrackerPlugin.getPlatformVersion(), '42');
  });
}
